<ion-view title="借出" hide-nav-bar="true">

	<ion-header-bar align-title="center" class="nav-bar-block" nav-bar="active">
	  <div class="buttons">
	    <button ng-click="backMy()" class="button back-button buttons button-clear header-item" style="color: black;">
			<i class="icon ion-ios-arrow-left"></i> 
  			<span class="back-text" style="transform: translate3d(0px, 0px, 0px);">
  				<span class="default-title">借出</span>
  			</span>
		</button>
	  </div>
	  <div class="button-bar">
		  <a class="button" style="width: 50px;margin: 0 auto;margin-left: 10%;border: 1px solid #42bd55;background-color: white;color: #42bd55;font-size:14px;font-family: '微软雅黑';">短贷</a>
		  <a ng-href="#/tab/my/loanChang" class="button" style="width: 50px;margin: 0 auto;margin-right: 10%;border:1px solid #888888;color: #888888;border-left:0px;background-color: white;font-size:14px;font-family: '微软雅黑';">长贷</a>
	  </div>
	  <div class="buttons">
	    <button class="button" style="background-color: white;" ng-click="toTip()">借不到钱?</button>
	  </div>
	</ion-header-bar>

	<ion-content delegate-handle="changScroll" style="background-color:#f5f5f5;">
		
		<style type="text/css">
		.item-complex.item-icon-right .item-content{
			padding-top:10px;
			padding-right: 0px;
		}
		.item-avatar, .item-avatar .item-content, .item-avatar-left, .item-avatar-left .item-content{
			padding-left:0px;
		}
		
		.item-complex .item-content, .item-radio .item-content{
			padding:0px;
		}
		.item-icon-right{
			padding-right:0px;
		}

		.gray{
  			color:#aaaaaa;
		}
		.yellow{
  		   color:#ffc33d;
		}
		</style>
		
		<div style="width: 100%;height: 41px;font-size:16px;background-color: white;padding-top:10px;margin-top:10px;">
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==1">
			  <a style="text-align: center;width: 110px;color: #42bd55;border-bottom: 1px solid #42bd55;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(2)">已收回</a>
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(3)">逾期</a>
			</div>
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==2">
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #42bd55;border-bottom: 1px solid #42bd55;" ng-click="changeSel(2)">已收回</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #888888;" ng-click="changeSel(3)">逾期</a>
			</div>
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==3">
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #888888;" ng-click="changeSel(2)">已收回</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #42bd55;border-bottom: 1px solid #42bd55;" ng-click="changeSel(3)">逾期</a>
			</div>
		</div>

		<ion-list ng-if="borrowStatus==1">
	      <ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="produce in currentProduceList" type="item-text-wrap" style="font-size: 13px;padding-bottom:0px;padding-top:0px;">
		        <div style="height: 133px;padding-left:10px;padding-right:10px;padding-top:10px;">
		        	<div>
		        		<i ng-if="produce.isAttention" ng-click="deleteAttention(produce.produceUserId)"  class="icon ion-heart yellow"   style="font-size: 25px; height:50px;left: 40%;width: 10%;" ></i>	
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid blue;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">借出(元)</div>
			        	<div style="height: 15px;font-size: 13px;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;text-align: right;">
			        		<span ng-if="produce.deadLine==0">今日还款</span>
			        		<span ng-if="produce.deadLine<0" style="color: red;">已逾期</span>
			        		<span ng-if="produce.deadLine>0">还有{{produce.deadLine}}天还款</span>
			        	</div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;">{{produce.loanMoney | number:0}}</div>
			        	<div style="float: left;width: 50%;height: 20px;line-height: 20px;text-align: right;color:#387ef5;" ng-click="showUserInfo(produce.produceUserId)">借给：{{produce.name}}</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;">
		        		<div style="width: 50%;float:left;height: 40px;line-height: 30px;">
			        		<div>待收利息&nbsp;{{produce.interest}}元</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 40px;line-height: 30px;">
			        		<div>借款日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.deadTime | date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
	        	</div>
	        	<div style="clear: left;">&nbsp;</div>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="cNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="cNoMore" on-infinite="loadCurrentProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
	    
	    <ion-list ng-if="borrowStatus==2">
	      <ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="produce in allReadyProduceList" type="item-text-wrap" style="font-size: 13px;padding-bottom:0px;padding-top:0px;">
	        	<div style="height: 133px;padding-left:10px;padding-right:10px;padding-top:10px;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid #387ef5;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">
			        	<!--<a href="#/tab/zjrCreditCheck/{{produce.produceUserId}}" >-->	<span  style="color: #387ef5;" ng-click="showUserInfo(produce.produceUserId)">{{produce.name}}</span><!--</a>-->&nbsp;已还(元)
			        	</div>
			        	<div ng-if="produce.isAttention"><i class="icon ion-heart yellow" style="font-size: 25px; height:50px;" ng-click="deleteAttention(produce.produceUserId)"></i></div>
			        	<div ng-if="!produce.isAttention"><i class="icon ion-heart gray" style="font-size: 25px; height:50px;" ng-click="addAttention(produce.produceUserId)"></i></div>
			        	<div style="height: 15px;font-size: 13px;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;text-align: right;"></div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;">{{produce.loanMoney+produce.breakMoney+produce.interest | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 40px;line-height: 40px;text-align: right;color: red;" ng-if="produce.breakMoney>0">违约金：{{produce.breakMoney | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 40px;line-height: 40px;text-align: right;color: green;" ng-if="produce.earlyDay<=-1">提前{{-produce.earlyDay}}天还款</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;">
		        		<div style="width: 50%;float:left;height: 40px;line-height: 30px;">
			        		<div>其中利息&nbsp;{{produce.interest}}元</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:2}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 40px;line-height: 30px;">
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.deadTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
		        </div>
		        <div style="clear: left;">&nbsp;</div>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="aNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="aNoMore" on-infinite="loadAllReadyProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
	    
	    <ion-list ng-if="borrowStatus==3">
	      <ion-item class="item-remove-animate item-avatar" ng-repeat="produce in breakProduceList" type="item-text-wrap" style="font-size: 13px;padding-bottom:0px;padding-top:0px;">
	        	<div style="height: 133px;padding-left:10px;padding-right:10px;padding-top:10px;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid #387ef5;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">
			        		<span style="color: #387ef5;" ng-click="showUserInfo(produce.produceUserId,produce.produceId)">{{produce.name}}</span>&nbsp;应还(元)
			        	</div>
			        	<div style="float: left;width: 10%;">
			        		<span>
				        		<i ng-if="produce.isAttention" class="icon ion-heart yellow" style="font-size: 25px; height:50px;" ng-click="deleteAttention(produce.produceUserId)"></i>
				        		<i ng-if="!produce.isAttention" class="icon ion-heart gray" style="font-size: 25px; height:50px;" ng-click="addAttention(produce.produceUserId)"></i>
			        		</span>
			        	</div>
			 	      	<div style="font-size: 13px;line-height: 15px;margin-bottom: 10px;width:30%;float: right;text-align: right;" ng-if="produce.deadLine*-1>=6" ng-click="toBlack(produce.produceId)"> 
			        		<a style=" text-decoration:underline; color:#000; font-size:13px; line-height:15px; display:block; float:right">黑名单></a> 
			        		<span style="width:20px; height:20px; background:#000; color:#fff; text-align:center; line-height:20px; display:block; border-radius:100%;font-size:12px; float:right; margin-right:5px; margin-top:-2px">黑</span> 		        	
			        	</div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;" ng-click="loanCollection(1,produce.produceId)">{{produce.loanMoney+produce.breakMoney+produce.interest | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 15px;line-height: 15px;text-align: right;" ng-if="produce.breakMoney>0" ng-click="loanCollection(1,produce.produceId)">已逾期{{produce.deadLine*-1}}天</div>
			        	<div style="float: left;width: 50%;height: 25px;line-height: 25px;text-align: right;color: red;" ng-if="produce.breakMoney>0" ng-click="loanCollection(1,produce.produceId)">违约金：{{produce.breakMoney | number:2}}</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;" ng-click="loanCollection(1,produce.produceId)">
		        		<div style="width: 50%;float:left;height: 40px;line-height: 30px;">
			        		<div>其中利息&nbsp;{{produce.interest}}元</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:2}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 40px;line-height: 30px;">
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.deadTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
		        </div>
		        <div style="clear: left;">&nbsp;</div>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="bNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="bNoMore" on-infinite="loadBreakProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
	    
	    <div style="font-size: 10px;text-align: center;color: #ccc;">{{msg}}</div>

	</ion-content>
</ion-view>